package org.idea.qiyu.framework.rocketmq.order.consumer.listener;

import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.common.message.MessageExt;
import org.idea.qiyu.framework.rocketmq.annotation.QiyuConsumer;
import org.idea.qiyu.framework.rocketmq.config.consumer.IConcurrentlyConsumer;
import org.idea.qiyu.framework.rocketmq.config.serializer.SerializerUtils;

/**
 * @Author linhao
 * @Date created in 5:55 下午 2021/7/2
 */
@QiyuConsumer(topic = "qiyu-topic", groupName = "user-pay-topic-group", tag = "qiyu")
public class ConcurrentlyConsumerListener implements IConcurrentlyConsumer<MessageExt> {

    @Override
    public ConsumeConcurrentlyStatus consume(MessageExt msg) {
        String data = SerializerUtils.getDataFromFastJson(msg.getBody(), String.class);
        System.out.println(data);
        return ConsumeConcurrentlyStatus.RECONSUME_LATER;
    }
}
